home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 13
/
Aminet 13 - August 1996.iso
/
MainActor
/
Rexx
/
LoadMPEG_HAM8.ma
< prev
next >
Wrap
Text File
|
1996-07-09
|
4KB
|
137 lines
/* */
/* LoadMPEG_adpro.ma Alex Kazik 1994 */
/* LoadMPEG_HAM6.ma */
/* LoadMPEG_HAM8.ma Alle drei ARexx-Scripte sind zum laden von */
/* MPEG-Animationen. Das Script xxx_adpro konvertiert */
/* die Bilder mit hilfe von ADPro auf ein beliebiges */
/* Format, dir Dither und Palette Option wird unterstützt. Dir Scripte */
/* xxx_HAM* wandeln die Anim ohne ADPro in das HAM6/HAM8 format um. */
/* */
/* Alle verwendeten Programme zur decodiering der MPEG-Anims sowie der */
/* Konvertierung yuv2ppm und ppm2ilbm sind Public-Domain. */
/* */
/* */
/* please read the .doc for english infomation */
OPTIONS RESULTS
address MAINACTOR
printandstoretxt "ALX:MPEG Loader - by Alex Kazik 1994"
RequestFile "Select MPEG-File"
IF RC = 10 THEN
call xEXIT 1
mpgfile = RESULT
if ( exists(mpgfile) = 0 ) then
call xexit 6
RequestSaveFile "Select Dest-File"
IF RC = 10 THEN
call xEXIT 1
newname = RESULT
IF exists(newname) then do
printtxt "ALX:File already exists, replace?"
RequestSaveFile "Replace File -> select again!"
IF (RC = 10) | (RESULT ~= newname) then
call xexit 5
ADDRESS COMMAND 'delete' newname
end
printtxt "ALX:Decoding MPEG..."
ADDRESS COMMAND 'copy' mpgfile newname || '.mpg'
wbtofront
ADDRESS COMMAND 'MainActor:mpeg/mpeg -d' newname '>CON:'
screentofront
printtxt "ALX:Deleting TEMP."
ADDRESS COMMAND 'delete' newname || '.mpg'
pics=0
picname = newname || pics
if exists(picname || ".Y") = 0 then do
call xexit 2
end
if exists(picname || ".U") = 0 then do
call xexit 2
end
if exists(picname || ".V") = 0 then do
call xexit 2
end
pics=1
picname = newname || pics
if exists(picname || ".Y") = 0 then do
call xexit 7
end
if exists(picname || ".U") = 0 then do
call xexit 7
end
if exists(picname || ".V") = 0 then do
call xexit 7
end
xxx = 1
do while xxx = 1
pics = pics + 1
picname = newname || pics
if exists(picname || ".Y") = 0 then
xxx = 0
if exists(picname || ".U") = 0 then
xxx = 0
if exists(picname || ".V") = 0 then
xxx = 0
end
printandstoretxt "ALX:Could find" pics "Pictures."
RequestInteger 352 "Original picture-width of the MEPG"
IF RC = 10 THEN
call xEXIT
width=RESULT
RequestInteger 240 "Original picture-height of the MPEG"
IF RC = 10 THEN
call xEXIT 1
height=RESULT
DO i=1 to pics
yuvpic = i - 1
yuvname = newname || yuvpic
actualpic=newname || "." || Right("00000" || i, 5)
printtxt "ALX:Converting Pic" i || "/" || pics || ". (YUV -> PPM)"
ADDRESS COMMAND 'MainActor:mpeg/cyuv2ppm' yuvname 'T:ppm.TEMP' '-iw' width '-ih' height
printtxt "ALX:Converting Pic" i || "/" || pics || ". (PPM -> IFF)"
ADDRESS COMMAND 'MainActor:mpeg/ppmtoilbm >' || actualpic '-ham8 -hamFORCE' 'T:ppm.TEMP'
printtxt "ALX:Converting Pic" i || "/" || pics || ". (deleting TEMP)"
ADDRESS COMMAND 'delete' yuvname || ".?"
END
ADDRESS COMMAND 'delete t:ppm.TEMP'
ADDRESS MAINACTOR
GetSPName
if (rc = 0) then
OpenNewProject
SetSPLoader "PIC" "IFF"
LoadProject newname || ".00001" actualpic
CALL xEXIT 0
xexit:
ARG fehler
if (fehler = 0) then
fehler = "Done."
else if (fehler = 1) then
fehler = "Aborted!"
else if (fehler = 2) then
fehler = "Error while decoding."
else if (fehler = 5) then
fehler = "File already exists."
else if (fehler = 6) then
fehler = "File don't exist."
else if (fehler = 7) then
fehler = "Anim must have min. 2 Pics."
address MAINACTOR
Screentofront
PrintAndStoreTxt "ALX:" || fehler
exit